unit uTakeImageThread;

interface
{$I indyver.inc}
uses
  Classes,
  SysUtils,
  TypInfo,
  Variants,
  XMLDoc,
  DB,
  ADODB, uADOdm,
  ShoppingServiceXMLClasses,
  EbayConnect,
  Forms,
  idThread;

type

  TCompleteCheckThread =  class(TidThread)
  private
     // Private declarations
     FForm        : TForm;
     FOperationResult : AckCodeType;
     FErrorRecord   : eBayAPIError;
     //FCounter       : Integer;
     //FCounterAll    : Integer;
     FEClassName    : string;
     FEMessage      : string;
     FEItemId       : string;
     RecAdded       : Integer;
  protected
     // Protected declarations
     procedure GetMultipleItemsAPIError(Sender: TObject; ErrorRecord: eBayAPIError);
     procedure GetMultipleItemsEndRequest(Sender: TObject);
     procedure GetMultipleItemsStartRequest(Sender: TObject);
     procedure DecTCounter;
     procedure WriteEbayApiExceptionLog(E : Exception);
     procedure WriteExceptionLog(E: Exception);
    {$IFDEF INDY10}procedure EbayShoppingConnectWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64);{$ENDIF}
    {$IFDEF INDY9}procedure EbayShoppingConnectWork(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer);{$ENDIF}
  public
     // Public declarations
     TID                   : Integer;
     // Objects visible outside threads
     FEbayShoppingConnect  : TEbayShoppingConnect;
     FGetMultipleItems     : TGetMultipleItems;
     FQuery1      : TADOQuery;
     FQuery2      : TADOQuery;
     FQuery3      : TADOTable;
     FCConnection  : TADOConnection;
     FAppID       : string;
     FSiteID      : SiteCodeType;
     FConnectString : string;
     FSearchTimeStr : string;
     FItemsToGet    : TStringList;
     FDataBase      : string;
     FServer        : string;
     FUser          : string;
     FPassword      : string;

     FTimeShift   : TDateTime;
     FMess        : string;
     // methods
     constructor  Create(Form: TForm);
     destructor Destroy; override;
     procedure Execute; override;
     procedure LogApiError;
     procedure LogEndRequest;
     procedure LogStartRequest;
     procedure LogProcess;
     procedure WriteToDB;
     procedure ReturnThreadResult;
     procedure PrepareFQuery;
     procedure DecTCounter;
     procedure WriteExceptionLog;
     procedure WriteLog;
  end;

implementation

end.
